﻿	<div class="narrow">
		<div class="narrow_l">
			<?php if(is_single() && function_exists('ihao_get_same_category_post')) {  ?>
			<p class="title"><span class="stronge">Related Articles</span></p>
			<ul class="linkage">
				<?php $post_ID=$post->ID;ihao_get_same_category_post($post->ID, 12); ?>
			</ul>
			<?php } ?>
			<p class="title"><span class="stronge">Fresh Articles List</span></p>
			<?php// get_calendar(true); ?>
			<ul class="fresh">
				<?php wp_get_archives('type=postbypost&limit=12'); ?>
			</ul>
			<?php if ( is_home() && function_exists('ihao_recent_comments')) { ?>
			<p class="title"><span class="stronge">Fresh Comments</span></p>
			<ul class="linkage">
				<?php ihao_recent_comments('12'); ?>
			</ul>
			<?php } ?>
			<p class="title"><span class="stronge">Popular Articles List</span></p>
				<ul class="linkage">
				<?php $result = $wpdb->get_results("SELECT comment_count,ID,post_title FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 12");
				foreach ($result as $topten) {
				$postid = $topten->ID;
				$title = $topten->post_title;
				$commentcount = $topten->comment_count; 
				if ($commentcount != 0) {
				?>
				<li><a href="<?php echo get_permalink($postid); ?>"><?php echo $title ?> (<?php echo $commentcount ?>)</a></li>
				<?php } } ?>
			</ul>
			<?php if(function_exists('ihao_get_same_category_post')) {  ?>
			<p class="title"><span class="stronge">Most commented user</span></p>
			 <?php// get_calendar(true); ?>
			 <ul class="fresh">
			  <?php ihao_get_commentmembersstats(); ?>
			 </ul>
			<?php } ?>
			<?php if ( function_exists('ihao_random_posts')) { ?>
			<p class="title"><span class="stronge">Oldies, but Goodies!</span></p>
				<ul class="linkage">
					<?php ihao_random_posts('12', '80'); ?>
				</ul>
			<?php } ?>
		</div>

		<div class="narrow_r">
			<p class="title"><span class="stronge">Popular Tags</span></p>
			<ul class="linkage">
				<?php wp_list_categories('title_li=&orderby=count&order=desc&show_count=1&hierarchical=true&feed=RSS&number=12'); ?>
			</ul>
			<p class="title"><span class="stronge">Monthly Archives</span></p>
			<ul class="linkage">
	 			<?php wp_get_archives('type=monthly&limit=12&show_post_count=1'); ?>
			</ul>
			<p class="title"><span class="stronge">iHao Friends</span></p>
			<ul class="linkage">
				<?php get_links('-1', '<li>', '</li>', '', FALSE, 'rating', FALSE, FALSE, 10, FALSE, TRUE); ?>
			</ul>
			<p class="title"><span class="stronge">Site Meta</span></p>
			<ul class="linkage">
				<?php wp_register(); ?>
				<li><?php wp_loginout(); ?></li>
				<li><a href="http://technorati.com/profile/ihao" title="My Technorati Profile">Technorati</a></li>
				<li><a href="http://www.feedburner.com/" title="Feed By FeedBurner">FeedBurner</a></li>
				<li><a href="http://www.haveamint.com/" title="MINT Analytics">MINT</a></li>
				<li><a href="http://mediatemple.net/" title="Hosted By MediaTemple">MediaTemple</a></li>
				<li><a href="http://www.text-link-ads.com/?ref=98605" title="Make Money">Join Text Link Ads</a></li>
				<?php wp_meta(); ?>
			</ul>
		</div>
	</div>
